package com.zengqingfa.designpattern.structure.composite;

/**
 * @author zengqingfa
 * @className Client
 * @description
 * @create 2021/8/29 18:22
 */
public class Client {
    public static void main(String[] args) {
        /**
         * 树叶1：被访问！
         * 树叶2：被访问！
         * 树叶3：被访问！
         */
        Component c = new Composite();
        Component leaf1 = new Leaf("1");
        Component leaf2 = new Leaf("2");
        Component leaf3 = new Leaf("3");
        c.add(leaf1);
        c.add(leaf2);
        c.add(leaf3);
        c.operation();
    }
}